home *** CD-ROM | disk | FTP | other *** search
- /**/
-
- signal on halt
- signal on break_c
-
- call Init
- call CreateApp
- call HandleApp
-
- /* never reached */
- /***********************************************************************/
- Init: procedure expose global.
- l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
- if AddLibrary("rxmui.library","rxcd.library")~=0 then exit
- call RxMUIOpt("debugmode showerr")
- global.device="cd0"
- return
- /***********************************************************************/
- HandleApp: procedure expose global.
- ctrl_c=2**12
- do forever
- call NewHandle("app","h",ctrl_c)
- if and(h.signals,ctrl_c)>0 then exit
- if h.EventFlag then
- select
- when h.event="QUIT" then exit
- otherwise interpret h.event
- end
- end
- /* never reached */
- /***********************************************************************/
- CreateApp: procedure expose global.
-
- app.Title="RxCDInfoExample"
- app.Version="$VER: RxCDInfoExample 1.0 (18.9.2001)"
- app.Copyright="Copyright 2001 by Alfonso Ranieri"
- app.Author="Alfonso Ranieri"
- app.Description="RxCD Info Example"
- app.Base="RXMUIEXAMPLE"
- app.SubWindow="win"
- win.ID="MAIN"
- win.Title="RxCD Info"
- win.Contents="mgroup"
-
- mgroup.0="cdg"
- cdg.Class="Group"
- cdg.Horiz=1
- cdg.0=Label("_Device")
- cdg.1=String("Device",'d',global.device)
-
- mgroup.1="ig"
- ig.Class="Group"
- ig.Columns=2
- ig.Frame="Group"
- ig.FrameTitle="Info"
- call child("ig",Label("Vendor"))
- call child("ig",Text("Vendor"))
- call child("ig",Label("Product"))
- call child("ig",Text("Product"))
- call child("ig",Label("Revision"))
- call child("ig",Text("Revision"))
- call child("ig",Label("Qualifier"))
- call child("ig",Text("Qualifier"))
- call child("ig",Label("Type"))
- call child("ig",Text("Type"))
- call child("ig",Label("Removable"))
- call child("ig",Text("Removable"))
- call child("ig",Label("Modifier"))
- call child("ig",Text("Modifier"))
- call child("ig",Label("ISO"))
- call child("ig",Text("ISO"))
- call child("ig",Label("ECMA"))
- call child("ig",Text("ECMA"))
- call child("ig",Label("ANSI"))
- call child("ig",Text("ANSI"))
- call child("ig",Label("AENC"))
- call child("ig",Text("AENC"))
- call child("ig",Label("TrmIOP"))
- call child("ig",Text("TrmIOP"))
- call child("ig",Label("RDF"))
- call child("ig",Text("RDF"))
- call child("ig",Label("RelAddr"))
- call child("ig",Text("RelAddr"))
- call child("ig",Label("WBus"))
- call child("ig",Text("WBus"))
- call child("ig",Label("Sync"))
- call child("ig",Text("Sync"))
- call child("ig",Label("Linked"))
- call child("ig",Text("Linked"))
- call child("ig",Label("CmdQueue"))
- call child("ig",Text("CmdQueue"))
- call child("ig",Label("SoftReset"))
- call child("ig",Text("SoftReset"))
-
- mgroup.2=Text("Info","Retreives CD driver information")
-
- mgroup.3="bg"
- bg.Class="Group"
- bg.Horiz=1
- bg.0=Button("Get","_Get")
- bg.1=HSpace()
- bg.2=Button("Quit","_Quit")
-
- if NewObj("application","app")>0 then exit
-
- call Notify("win","CloseRequest",1,"app","ReturnID","quit")
-
- call Notify("device","NewContents","EveryTime","app","SetVar","global.device","TriggerValue")
- call Notify("get","Pressed",0,"app","Return","call GetFun")
- call Notify("quit","Pressed",0,"app","ReturnID","Quit")
-
- call set("win","open",1)
- if ~xget("win","open") then do
- say "can't open window"
- exit
- end
-
- return
- /***********************************************************************/
- halt:
- break_c:
- exit
- /**************************************************************************/
- GetFun: procedure expose global.
- res=CDInfo(global.device,"db","info")
- if res>0 then do
- call set("Info","Contents",GetRxCDString(res))
- return
- end
- call set("Vendor","contents",info.Vendor)
- call set("Product","contents",info.Product)
- call set("Revision","contents",info.Revision)
- call set("Qualifier","contents",info.PeripheralQualifier)
- call set("Type","contents",info.PeripheralType)
- call set("Removable","contents",info.Removable)
- call set("Modifier","contents",info.Modifier)
- call set("ISO","contents",info.ISO)
- call set("ECMA","contents",info.ECMA)
- call set("ANSI","contents",info.ANSI)
- call set("AENC","contents",info.AENC)
- call set("TrmIOP","contents",info.TrmIOP)
- call set("RDF","contents",info.RDF)
- call set("RelAddr","contents",info.RelAddr)
- if info.WBus32 then wb=32
- else if info.WBus16 then wb=16
- else wb=8
- call set("WBus","contents",wb)
- call set("Sync","contents",info.Sync)
- call set("Linked","contents",info.Linked)
- call set("CmdQueue","contents",info.CmdQueue)
- call set("SoftReset","contents",info.SoftReset)
- call set("Info","contents","Done.")
- return
- /**************************************************************************/
-